* April 10, 2020
* Human Rights Institutionalization 

set matsize 240
set more off

use "F:\research, journal papers\US military intervention and media effect with Jenifer\replication materials\data\HRinstitutionalization.dta", clear


******************* Table 1 *******************
sum usintervene_human1 state latentmean physint amnesty nythr avmdia state_nythr senate_score senate_nythr usintervene_human polity2 log_gdppc us_allied us_distance_logged coldwar oil_petroleum military onset2cv410 americas europe africa middleeast asia oceanania 


******************* Table 2 *******************
logit usintervene_human1 state nythr usintervene_human, cluster(ccode)
 est store mod1
logit usintervene_human1 state nythr usintervene_human americas africa middleeast asia oceanania, cluster(ccode)
 est store mod2
logit usintervene_human1 state nythr state_nythr senate_score senate_nythr polity2 log_gdppc us_allied us_distance_logged coldwar usintervene_human, cluster(ccode)
 est store mod3
logit usintervene_human1 state nythr state_nythr senate_score senate_nythr polity2 log_gdppc us_allied us_distance_logged coldwar usintervene_human americas africa middleeast asia oceanania, cluster(ccode)
 est store mod4
esttab mod*, b(3) se(3) stats(N ll r2) keep(state nythr state_nythr senate_score senate_nythr polity2 log_gdppc us_allied us_distance_logged coldwar americas africa middleeast asia oceanania _cons)
estimates clear


******************* Table 3 *******************
*logit with clustering
logit usintervene_human1 state nythr state_nythr senate_score senate_nythr polity2 log_gdppc us_allied us_distance_logged usintervene_human oil_petroleum military onset2cv410, cluster(ccode)
 est store mod1
logit usintervene_human1 state nythr state_nythr senate_score senate_nythr polity2 log_gdppc us_allied us_distance_logged usintervene_human oil_petroleum military onset2cv410 americas africa asia oceanania, cluster(ccode)
 est store mod2
*peace years 
drop py _spline* 
btscs usintervene_human1 year ccode, gen(py) nspline(1) 
sort ccode year 
logit usintervene_human1       state nythr state_nythr senate_score senate_nythr polity2 log_gdppc us_allied us_distance_logged oil_petroleum military onset2cv410 py _spline*, cluster(ccode) 
 est store mod3
drop py _spline* 
btscs usintervene_human1 year ccode, gen(py) nspline(1) 
sort ccode year 
logit usintervene_human1       state nythr state_nythr senate_score senate_nythr polity2 log_gdppc us_allied us_distance_logged oil_petroleum military onset2cv410 americas africa asia oceanania py _spline*, cluster(ccode) 
 est store mod4
*xtgee
xtgee usintervene_human1       state nythr state_nythr senate_score senate_nythr polity2 log_gdppc us_allied us_distance_logged oil_petroleum military onset2cv410, family (binomial) link (logit) corr (ar1) force robust nolog 
 est store mod5
xtgee usintervene_human1       state nythr state_nythr senate_score senate_nythr polity2 log_gdppc us_allied us_distance_logged oil_petroleum military onset2cv410 americas africa asia oceanania, family (binomial) link (logit) corr (ar1) force robust nolog 
 est store mod6
*relogit
relogit usintervene_human1       state nythr state_nythr senate_score senate_nythr polity2 log_gdppc us_allied us_distance_logged oil_petroleum military onset2cv410 
 est store mod7
relogit usintervene_human1       state nythr state_nythr senate_score senate_nythr polity2 log_gdppc us_allied us_distance_logged oil_petroleum military onset2cv410 americas africa asia oceanania
 est store mod8
esttab mod*, b(3) se(3) stats(N ll r2) keep(state nythr state_nythr senate_score senate_nythr polity2 log_gdppc us_allied us_distance_logged oil_petroleum military onset2cv410 usintervene_human americas africa asia oceanania _cons)
estimates clear



******************* Appendix 1, descriptive country reports from the State Department *******************


******************* Appendix 2 *******************
corr state latentmean physint amnesty


******************* Appendix 3 *******************
*Fariss' human rights index
********************* logit with clustering
logit usintervene_human1 latentmean nythr latentmean_nythr senate_score senate_nythr polity2 log_gdppc us_allied us_distance_logged usintervene_human oil_petroleum military onset2cv410, cluster(ccode)
 est store mod1
logit usintervene_human1 latentmean nythr latentmean_nythr senate_score senate_nythr polity2 log_gdppc us_allied us_distance_logged usintervene_human oil_petroleum military onset2cv410 americas africa asia oceanania, cluster(ccode)
 est store mod2
*physint
********************* logit with clustering
logit usintervene_human1 physint nythr physint_nythr senate_score senate_nythr polity2 log_gdppc us_allied us_distance_logged usintervene_human oil_petroleum military onset2cv410, cluster(ccode)
 est store mod3
logit usintervene_human1 physint nythr physint_nythr senate_score senate_nythr polity2 log_gdppc us_allied us_distance_logged usintervene_human oil_petroleum military onset2cv410 americas africa asia oceanania, cluster(ccode)
 est store mod4
*amnesty
********************* logit with clustering
logit usintervene_human1 amnesty nythr amnesty_nythr senate_score senate_nythr polity2 log_gdppc us_allied us_distance_logged usintervene_human oil_petroleum military onset2cv410, cluster(ccode)
 est store mod5
logit usintervene_human1 amnesty nythr amnesty_nythr senate_score senate_nythr polity2 log_gdppc us_allied us_distance_logged usintervene_human oil_petroleum military onset2cv410 americas africa asia oceanania, cluster(ccode)
 est store mod6
 esttab mod*, b(3) se(3) stats(N ll r2) keep(latentmean nythr latentmean_nythr senate_score senate_nythr polity2 log_gdppc us_allied us_distance_logged oil_petroleum military onset2cv410 usintervene_human americas africa asia oceanania physint physint_nythr amnesty amnesty_nythr _cons)
estimates clear


******************* Appendix 4 *******************
*Fariss' human rights index
********************* logit with clustering
logit usintervene_human1 latentmean avmdia latentmean_avmdia senate_score senate_avmdia polity2 log_gdppc us_allied us_distance_logged usintervene_human oil_petroleum military onset2cv410, cluster(ccode)
 est store mod1
logit usintervene_human1 latentmean avmdia latentmean_avmdia senate_score senate_avmdia polity2 log_gdppc us_allied us_distance_logged usintervene_human oil_petroleum military onset2cv410 americas africa asia oceanania, cluster(ccode)
 est store mod2
*physint
********************* logit with clustering
logit usintervene_human1 physint avmdia senate_score senate_avmdia polity2 log_gdppc us_allied us_distance_logged usintervene_human oil_petroleum military, cluster(ccode)
 est store mod3
logit usintervene_human1 physint avmdia senate_score senate_avmdia polity2 log_gdppc us_allied us_distance_logged usintervene_human oil_petroleum military americas africa asia oceanania, cluster(ccode)
 est store mod4
*amnesty
********************* logit with clustering
logit usintervene_human1 amnesty avmdia amnesty_avmdia senate_score senate_avmdia polity2 log_gdppc us_allied us_distance_logged usintervene_human oil_petroleum military onset2cv410, cluster(ccode)
 est store mod5
logit usintervene_human1 amnesty avmdia amnesty_avmdia senate_score senate_avmdia polity2 log_gdppc us_allied us_distance_logged usintervene_human oil_petroleum military onset2cv410 americas africa asia oceanania, cluster(ccode)
 est store mod6
 esttab mod*, b(3) se(3) stats(N ll r2) keep(latentmean avmdia latentmean_avmdia senate_score senate_avmdia polity2 log_gdppc us_allied us_distance_logged oil_petroleum military onset2cv410 usintervene_human americas africa asia oceanania physint amnesty amnesty_avmdia _cons)
estimates clear


******************* Appendix 5 *******************
*peace years 
drop py _spline* 
btscs usintervene_human1 year ccode, gen(py) nspline(1) 
sort ccode year 
logit usintervene_human1       state nythr state_nythr senate_score senate_nythr polity2 log_gdppc us_allied us_distance_logged coldwar py _spline*, cluster(ccode) 
 est store mod3
drop py _spline* 
btscs usintervene_human1 year ccode, gen(py) nspline(1) 
sort ccode year 
logit usintervene_human1       state nythr state_nythr senate_score senate_nythr polity2 log_gdppc us_allied us_distance_logged coldwar americas africa middleeast asia oceanania py _spline*, cluster(ccode) 
 est store mod4
*xtgee
xtgee usintervene_human1       state nythr state_nythr senate_score senate_nythr polity2 log_gdppc us_allied us_distance_logged coldwar, family (binomial) link (logit) corr (ar1) force robust nolog 
 est store mod5
xtgee usintervene_human1       state nythr state_nythr senate_score senate_nythr polity2 log_gdppc us_allied us_distance_logged coldwar americas africa middleeast asia oceanania, family (binomial) link (logit) corr (ar1) force robust nolog 
 est store mod6
*relogit
relogit usintervene_human1       state nythr state_nythr senate_score senate_nythr polity2 log_gdppc us_allied us_distance_logged coldwar 
 est store mod7
relogit usintervene_human1       state nythr state_nythr senate_score senate_nythr polity2 log_gdppc us_allied us_distance_logged coldwar americas africa middleeast asia oceanania
 est store mod8
esttab mod*, b(3) se(3) stats(N ll r2) keep(state nythr state_nythr senate_score senate_nythr polity2 log_gdppc us_allied us_distance_logged coldwar americas africa middleeast asia oceanania _cons)
estimates clear


******************* Appendix 6 *******************
*logit with clustering
logit usintervene_human state nythr state_nythr senate_score senate_nythr polity2 log_gdppc us_allied us_distance_logged coldwar, cluster(ccode)
 est store mod1
logit usintervene_human state nythr state_nythr senate_score senate_nythr polity2 log_gdppc us_allied us_distance_logged coldwar americas africa middleeast asia oceanania, cluster(ccode)
 est store mod2
*peace years 
drop py _spline* 
btscs usintervene_human year ccode, gen(py) nspline(1) 
sort ccode year 
logit usintervene_human       state nythr state_nythr senate_score senate_nythr polity2 log_gdppc us_allied us_distance_logged coldwar py _spline*, cluster(ccode) 
 est store mod3
drop py _spline* 
btscs usintervene_human year ccode, gen(py) nspline(1) 
sort ccode year 
logit usintervene_human       state nythr state_nythr senate_score senate_nythr polity2 log_gdppc us_allied us_distance_logged coldwar americas africa middleeast asia oceanania py _spline*, cluster(ccode) 
 est store mod4
*xtgee
xtgee usintervene_human       state nythr state_nythr senate_score senate_nythr polity2 log_gdppc us_allied us_distance_logged coldwar, family (binomial) link (logit) corr (ar1) force robust nolog 
 est store mod5
xtgee usintervene_human       state nythr state_nythr senate_score senate_nythr polity2 log_gdppc us_allied us_distance_logged coldwar americas africa middleeast asia oceanania, family (binomial) link (logit) corr (ar1) force robust nolog 
 est store mod6
*relogit
relogit usintervene_human       state nythr state_nythr senate_score senate_nythr polity2 log_gdppc us_allied us_distance_logged coldwar 
 est store mod7
relogit usintervene_human       state nythr state_nythr senate_score senate_nythr polity2 log_gdppc us_allied us_distance_logged coldwar americas africa middleeast asia oceanania
 est store mod8
esttab mod*, b(3) se(3) stats(N ll r2) keep(state nythr state_nythr senate_score senate_nythr polity2 log_gdppc us_allied us_distance_logged coldwar americas africa middleeast asia oceanania _cons)
estimates clear


******************* Appendix 7 *******************
logit usintervene_human1 state nythr state_nythr senate_score senate_nythr polity2 log_gdppc us_allied us_distance_logged coldwar usintervene_human, cluster(ccode)
prgen state_nythr, from(0) to(575) generate(prlfp) rest(mean) gap(57.5) ci
label var prlfpp1 "Predicted probability"
label var prlfpp1ub "95% upper limit"
label var prlfpp1lb "95% lower limit"
label var prlfpx "State Department * Media"
graph twoway                                          ///
   (connected prlfpp1 prlfpx,                         ///
       clcolor(black) clpat(solid) clwidth(medthick)  ///
	   msymbol(i) mcolor(none))                       ///
   (connected prlfpp1ub prlfpx,                       ///
	   msymbol(i) mcolor(none)                        ///
       clcolor(black) clpat(dash) clwidth(thin))      ///
   (connected prlfpp1lb prlfpx,                       ///
	   msymbol(i) mcolor(none)                        ///
       clcolor(black) clpat(dash) clwidth(thin)),     ///
	ytitle("Prob of U.S. Humanitarian Military Intervention")  ///
    yscale(range(0 .10))                              ///
	ylabel(, grid glwidth(medium) glpattern(solid))   ///
	xscale(range(0 575))                                ///
	xlabel(0(57.5)575)


























